package com.neu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neu.po.ResponseResult;
import com.neu.service.InventoryService;

@RestController
@RequestMapping("inventory")
public class InventoryController {

	@Autowired
	private InventoryService inventoryService;
	
	@RequestMapping("getPaged")
	public ResponseResult getPaged(int pageNum, int pageSize, String keyword) {
		ResponseResult result = new ResponseResult();
		
		result.setData(inventoryService.getPaged(pageNum, pageSize, keyword));
		
		return result;
	}
	
	@RequestMapping("getAllGoods")
	public ResponseResult getAllGoods() {
		ResponseResult result = new ResponseResult();
		
		result.setData(inventoryService.getAllGoods());
		
		return result;
	}
}
